/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package pe.edu.upc.sad.util;

import java.sql.Timestamp;
import java.text.SimpleDateFormat;
/**
 *
 * @author aalanya
 */
public class UFecha {

    public static final Timestamp getPresentDate ()
    {
       try
       {
            java.util.Date fecha= new java.util.Date();
            Timestamp outDate = null;

            SimpleDateFormat formato = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa");
            String cadenaFecha = formato.format(fecha);

            long time = new SimpleDateFormat("dd/MM/yyyy hh:mm:ss aa").parse(cadenaFecha).getTime();
            outDate = new Timestamp(time);

            return outDate;

        }
        catch (Exception e)
        {
            return null;
        }
    }
}
